//
//  FFRedPacketsContent.m
//  LiMaoRedPackets
//
//  Created by JayLuo on 2020/8/26.
//

#import "FFRedPacketsContent.h"
#import "FFRedPacketsModule.h"

@implementation FFRedPacketsContent

+ (FFRedPacketsContent *)redPacketNo:(NSString *)redPacketNo blessing:(NSString *)blessing {
    FFRedPacketsContent *content = [FFRedPacketsContent new];
//    content.uid = uid;
    content.redPacketNo = redPacketNo;
    content.blessing = blessing;
    return content;
}

- (NSDictionary *)encodeWithJSON {
    NSMutableDictionary *dict = [NSMutableDictionary new];
    dict[@"redpacket_no"] = self.redPacketNo?:@"";
    dict[@"blessing"] = self.blessing?:@"";
    return dict;
}

- (void)decodeWithJSON:(NSDictionary *)contentDic {
    self.redPacketNo = contentDic[@"redpacket_no"];
    self.blessing = contentDic[@"blessing"];
    if(!self.blessing || [self.blessing isEqualToString:@""]) {
        self.blessing = @"恭喜发财，大吉大利";
    }
}

+ (NSNumber *)contentType {
    return @(WK_REDPACKET);
}

- (NSString *)conversationDigest {
    return [NSString stringWithFormat:@"[%@红包]", [WKApp shared].config.appName];
}

- (NSString *)searchableWord {
    return [NSString stringWithFormat:@"[%@红包]", [WKApp shared].config.appName];
}

@end
